class Animal:
    def speak(self):
        print("我是动物我会说话")
class People(Animal):
    def speak(self):
        print("sy hello")
class Dog(Animal):
    def speak(self):
        print("汪汪汪")
class Pig(Animal):
    def speak(self):
        print("哼哼哼")

# 三个对象都是动物
obj1 = People()
obj2 = Dog()
obj3 = Pig()
"""
obj1.speak()
obj2.speak()
obj3.speak()
"""
# 封装成一个接口，统一对外去使用
def obj_speak(obj):
    obj.speak()

obj_speak(obj1)
obj_speak(obj2)
obj_speak(obj3)

class gbw(Animal):
    def speak(self):
        print("哈哈哈哈哈")
obj4 = gbw()
obj_speak(obj4)

